package br.com.cs.dao;

import br.com.cs.exception.CSException;

public class BaseDAOFactory {
    
    private static DAOFactory factory;
    
    /** Creates a new instance of BaseDAOFactory */
    
    public static DAOFactory getFactory() throws CSException{
        if (factory != null)
            return factory;
        else
            throw new CSException("DAOFactory não foi inicializada!!");
    }

    public static synchronized void setFactory(DAOFactory factory) {
        BaseDAOFactory.factory = factory;
    }
}
